# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BigtableAdmin.V2.Model.AuthorizedView do
  @moduledoc """
  An Authorized View of a Cloud Bigtable Table.

  ## Attributes

  *   `deletionProtection` (*type:* `boolean()`, *default:* `nil`) - Set to true to make the AuthorizedView protected against deletion. The parent Table and containing Instance cannot be deleted if an AuthorizedView has this bit set.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - The etag for this AuthorizedView. If this is provided on update, it must match the server's etag. The server returns ABORTED error on a mismatched etag.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. The name of this AuthorizedView. Values are of the form `projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`
  *   `subsetView` (*type:* `GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2AuthorizedViewSubsetView.t`, *default:* `nil`) - An AuthorizedView permitting access to an explicit subset of a Table.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :deletionProtection => boolean() | nil,
          :etag => String.t() | nil,
          :name => String.t() | nil,
          :subsetView =>
            GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2AuthorizedViewSubsetView.t()
            | nil
        }

  field(:deletionProtection)
  field(:etag)
  field(:name)

  field(:subsetView,
    as: GoogleApi.BigtableAdmin.V2.Model.GoogleBigtableAdminV2AuthorizedViewSubsetView
  )
end

defimpl Poison.Decoder, for: GoogleApi.BigtableAdmin.V2.Model.AuthorizedView do
  def decode(value, options) do
    GoogleApi.BigtableAdmin.V2.Model.AuthorizedView.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BigtableAdmin.V2.Model.AuthorizedView do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
